
/**
 * @author Team 29
 * This class documents a patient's basic information in the database.
 *
 */
public class BasicInfo {

	public String fullName;
	public String dateOfBirth;
	public String age;
	public String height;
	public String weight;
	
	public String getFullName(){
		return this.fullName;
	}
	public void setFullName(String fName){
		this.fullName = fName;
	}
	public String getDateOfBirth(){
		return this.dateOfBirth;
	}
	public void setDateOfBirth(String date){
		this.dateOfBirth = date;
	}
	public String getAge(){
		return this.age;
	}
	public void setAge(String age){
		this.age = age;
	}
	public String getHeight(){
		return this.height;
	}
	public void setHeight(String height){
		this.height = height;
	}
	public String getWeight(){
		return this.weight;
	}
	public void setWeight(String weight){
		this.weight = weight;
	}
	
	public BasicInfo(String s1, String s2, String s3, String s4, String s5)
	{
		fullName = s1;
		dateOfBirth = s2;
		age = s3;
		height = s4;
		weight = s5;
	}
	public String toString(){
		String s = fullName+"\t" +
			dateOfBirth + "\t" +
			age + "\t" +
			height + "\t" +
			weight;
		return s;
	}
	public static BasicInfo fromString(String basicInfo){
		try{
			String[] args = basicInfo.split("\t");
			return new BasicInfo(args[0],args[1],args[2],args[3],args[4]);
		}
		catch(Exception e){
			Logger.log("Error parsing basic info");
			return null;
		}
	}
}
